StorageAccessHandle: locks-Eigenschaft

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Die locks-Eigenschaft der StorageAccessHandle-Schnittstelle gibt ein nicht partitioniertes Sitzungs-LockManager-Objekt zurück, wenn der Zugriff gewährt wurde, und löst andernfalls einen SecurityError-DOMException aus.

Wert

Ein LockManager-Objekt.

Beispiele

js
document.requestStorageAccess({ locks: true }).then(
  (handle) => {
    console.log("locks access granted");
    handle.locks.request("foo", (lock) => "ok");
  },
  () => {
    console.log("locks access denied");
  },
);

Hinweis: Siehe Verwendung der Storage Access API für ein vollständigeres Beispiel.

Spezifikationen

Specification
Extending Storage Access API (SAA) to non-cookie storage
# ref-for-dom-storageaccesshandle-locks

Browser-Kompatibilität

Siehe auch